<!doctype html>
<html>
<!--最新浏览-->
<head>
<meta charset="utf-8">
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<title>${title}</title>
<link rel="stylesheet" href="${base}/css/default.css" type="text/css">
</head>
<body>
<header><a href="javascript:history.go(-1)" class="back"><span>返回</span></a><h2>最新浏览</h2></header>
<nav>
  <ul>
    <li class="n1"><a href="${base}/index/index"><cite></cite><span>首页</span></a></li>
    <li class="n2"><a href="${base}/search/index"><cite></cite><span>搜索</span></a></li>
    <li class="n3"><a href="${base}/subscribe/index"><cite></cite><span>订阅</span></a></li>
    <li class="n4"><a href="${base}/center/index"><cite></cite><span>我的</span></a></li>
  </ul>
</nav>
<div class="main">
    <div class="dli clearfix">
    	<ul>
    		<#list browselList as detail>
        	<li>
            	<a href="${base}/detail/index?id=${detail.id}&type=${detail.tableName}" title="">
                	<div class="dli-box">
                        <strong>${detail.title}</strong>
                        <div>
                            <p>类型:${detail.type}&nbsp;&nbsp;&nbsp;发布时间:${detail.updateTime}</p>
                            <b>${detail.area}</b>
                        </div>
                    </div>
                </a>
                <div class="favor"><span id="collect" value="${detail.id}" type="${detail.tableName}" <#if (detail.collect)>class="sc"</#if>>收藏</span></div>
            </li>
        	</#list>
        </ul>
    </div>
</div>
</body>
<script type="text/javascript" src="${base}/js/public/lib/zepto.min.js"></script>
<script type="text/javascript">
(function(w){
	$('#collect').on('click',function(){
		var $this = $(this);
		var id = $this.attr('value');
		var type = $this.attr('type');
		$.ajax({
			'url':'${base}/collect/insert',
			'type':'post',
			dataType:'json',
			data:{id:id,type:0},//0是news收藏
			success:function(data){
				alert(data.message);
			}
		});
		$(this).toggleClass('sc');
	});
}(window));
</script>
</html>
